package com.zfei.gfb.request;

import com.zfei.gfb.bean.Status;
import com.zfei.gfb.bean.StatusException;
import com.zfei.gfb.util.CheckStatus;
import io.swagger.annotations.ApiModelProperty;

import java.util.function.Consumer;


/**
 * @author fgh
 */
public class GfbSetRequest {

    @ApiModelProperty(value = "id", required = true)
    private Integer id;

    @ApiModelProperty(value = "状态", required = true)
    private Integer status;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public void checkSetNull(CheckStatus function) {
        if (id == null || status == null) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
        if (function != null) {
            function.doCheck(status);
        }
    }
}

